#include "stdafx.h"
#include "XSIPTCPServiceRebot.h"


IMPLEMENT_DYNCREATE(XSIPTCPServiceRebot) 

XSIPTCPServiceRebot::XSIPTCPServiceRebot(void)
{
	objName = "XSIPTCPServiceRebot";
	//m_lpszClassName = "ConfigureRebot";
	objType = E_OBJECT_TYPE::XOBJECT;
}


XSIPTCPServiceRebot::~XSIPTCPServiceRebot(void)
{
	delete mpServer;
}


unsigned int XSIPTCPServiceRebot::Init(const char * host, int port, string& serverType)
{
	
	printf("XSIPTCPServiceRebot: start...\" %s\" :%d :%s \n", host, port, serverType.c_str());
	mpServer = new CIocp;
	mpServer->CreateListenSocket(host,port, serverType);
	mpServer->InitIOPort();
	mpServer->ListenEx(10);

	return 0;
}

void XSIPTCPServiceRebot::PrintInfo()
{
	//printf("/************************************ robot = %d *************************************\n", mRegistRebotMap.size());
	XObject::PrintInfo();
	//printf(".....................................................................................\n");
	if(mpServer != NULL)
		mpServer->PrintInfo();
	//printf("*****************************************************************************************/\n");
}